/* link-station.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

body {
    background-color: #0a0a12;
    color: #e0e0ff;
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(28, 58, 173, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(115, 3, 192, 0.1) 0%, transparent 20%);
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(0, 183, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 183, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    gap: 10px;
}

/* 头部样式 */
.main-header {
    background: rgba(10, 15, 35, 0.8);
    border: 1px solid rgba(0, 183, 255, 0.3);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 183, 255, 0.1);
    backdrop-filter: blur(5px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    background: linear-gradient(135deg, #00b7ff, #0088cc);
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 10px rgba(0, 183, 255, 0.5);
}

.logo h1 {
    font-size: 28px;
    background: linear-gradient(90deg, #00b7ff, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(0, 183, 255, 0.3);
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4ade80;
}

.pulse {
    width: 10px;
    height: 10px;
    background-color: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.system-time {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #00b7ff;
    background: rgba(0, 0, 30, 0.7);
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid rgba(0, 183, 255, 0.5);
}

/* 主要内容区 */
.main-content {
    display: flex;
    flex: 1;
    gap: 15px;
    min-height: 0;
}

.chat-section, .tools-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-container, .tools-container {
    background: rgba(10, 15, 35, 0.8);
    border: 1px solid rgba(0, 183, 255, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 0 15px rgba(0, 183, 255, 0.1);
    backdrop-filter: blur(5px);
}

.chat-header, .tools-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 183, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2, .tools-header h2 {
    font-size: 20px;
    color: #00b7ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.btn-small {
    background: rgba(0, 183, 255, 0.1);
    border: 1px solid rgba(0, 183, 255, 0.4);
    color: #00b7ff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-small:hover {
    background: rgba(0, 183, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 183, 255, 0.3);
}

.system-stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #a855f7;
}

/* 聊天消息区 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #00b7ff, #0088cc);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
}

.message-content {
    background: rgba(20, 25, 60, 0.7);
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 183, 255, 0.2);
    flex: 1;
}

.user-message .message-content {
    background: rgba(40, 20, 70, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.message-sender {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: #00b7ff;
}

.user-message .message-sender {
    color: #a855f7;
    text-align: right;
}

.message-text {
    line-height: 1.5;
    margin-bottom: 5px;
}

.message-time {
    font-size: 12px;
    color: rgba(224, 224, 255, 0.6);
    text-align: right;
}

/* 聊天输入区 */
.chat-input-area {
    padding: 20px;
    border-top: 1px solid rgba(0, 183, 255, 0.2);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-wrapper input {
    flex: 1;
    background: rgba(20, 25, 60, 0.7);
    border: 1px solid rgba(0, 183, 255, 0.4);
    border-radius: 6px;
    padding: 12px 15px;
    color: #e0e0ff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.input-wrapper input:focus {
    border-color: #00b7ff;
    box-shadow: 0 0 10px rgba(0, 183, 255, 0.3);
}

.input-wrapper input::placeholder {
    color: rgba(224, 224, 255, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, #00b7ff, #0088cc);
    border: none;
    border-radius: 6px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.send-btn:hover {
    background: linear-gradient(135deg, #0088cc, #006699);
    box-shadow: 0 0 15px rgba(0, 183, 255, 0.5);
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    background: rgba(40, 20, 70, 0.5);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* 工具区样式 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    flex: 1;
    min-height: 0;
}

.tool-card {
    background: rgba(20, 25, 60, 0.7);
    border: 1px solid rgba(0, 183, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-card:hover {
    background: rgba(30, 35, 80, 0.8);
    border-color: #00b7ff;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 183, 255, 0.2);
}

.tool-icon {
    background: linear-gradient(135deg, #00b7ff, #0088cc);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
    color: white;
}

.tool-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #00b7ff;
}

.tool-card p {
    font-size: 14px;
    color: rgba(224, 224, 255, 0.7);
    line-height: 1.4;
}

.tool-output {
    border-top: 1px solid rgba(0, 183, 255, 0.2);
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.tool-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tool-output-content {
    background: rgba(10, 15, 35, 0.8);
    border-radius: 6px;
    padding: 15px;
    border: 1px solid rgba(0, 183, 255, 0.2);
    min-height: 100px;
}

.output-message {
    display: flex;
    gap: 10px;
}

.output-icon {
    color: #00b7ff;
    font-size: 18px;
    flex-shrink: 0;
}

.output-text {
    line-height: 1.5;
}

/* 状态栏 */
.status-bar {
    background: rgba(10, 15, 35, 0.8);
    border: 1px solid rgba(0, 183, 255, 0.3);
    border-radius: 8px;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 0 15px rgba(0, 183, 255, 0.1);
    backdrop-filter: blur(5px);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4ade80;
}

.led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.led-active {
    background-color: #4ade80;
    box-shadow: 0 0 5px #4ade80;
}

.status-message {
    color: rgba(224, 224, 255, 0.8);
}

.network-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00b7ff;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    display: none;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(10, 15, 35, 0.95);
    border: 1px solid rgba(0, 183, 255, 0.5);
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 183, 255, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 183, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 25, 60, 0.8);
}

.modal-header h2 {
    color: #00b7ff;
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    color: #00b7ff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-modal:hover {
    background: rgba(0, 183, 255, 0.1);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .main-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .message {
        max-width: 95%;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}